using System;
using System.Runtime.Serialization;
using Kollektiv.DB;
using Kollektiv.Extension;
using System.Collections.Generic;

namespace Kollektiv.DataModel
{
	[DataContract]
	public class User:DataObject
	{		
		[DataMember]
		public virtual string Email{ get; set; }
		
		[DataMember]
		public virtual string FirstName{ get; set; }
		
		[DataMember]
        public virtual string LastName { get; set; }

        [DataMember]
        public virtual Language Language { get; set; }
		
		[DataMember]
		public virtual string Certificate { get; set; }
		
		public virtual string PasswordHash{ get; private set; }
		
		public virtual string Password{ set { this.PasswordHash = value.GetPasswordHash (); } }
		
		[DataMember]
		public virtual bool Verified{ get; set; }
		
		public virtual bool VerifyPassword (string password)
		{
			return this.PasswordHash == password.GetPasswordHash ();
		}
	}
}

